package com.cangchu.util;

import android.content.Context;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.RequestParams;
import com.loopj.android.http.ResponseHandlerInterface;

/**
 * 基于android-async-http 封装的http请求工具类
 * Created by 张博文 on 2016/11/2.
 */
public class HttpUtils {

    private static AsyncHttpClient client = new AsyncHttpClient();

    //初始化设置
    static {

    }

    public static void get(Context context, String url, ResponseHandlerInterface handler)    //用一个完整url获取一个string对象
    {
        client.get(context, url, handler);
    }

    public static void post(Context context, String url, RequestParams params, ResponseHandlerInterface handler)    //用一个完整url获取一个string对象
    {
        client.post(context, url, params, handler);
    }

}
